//package com.example.demo.job;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//
//@Slf4j
//// 标记为配置类，Spring 会扫描并加载
//@Configuration
//// 启用定时任务功能，等价于在主类加 @EnableScheduling
//@EnableScheduling
//public class SpringAsyncJob {
//
//
//    @Async("taskExecutor") // 指定使用上面配置的线程池
//    @Scheduled(fixedRate = 2000)
//    public void execute() {
//        try {
//            Thread.sleep(10000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        log.info("异步定时任务执行，当前时间：{} 线程： {}", System.currentTimeMillis(), Thread.currentThread().getName());
//    }
//}